package Logic.dbUtils;

import Logic.utils.StringHandler;

/**
 * @author liujun
 * @version V1.0
 * @date 2022/3/12 7:28 PM
 * @author-Email ljfirst@mail.ustc.edu.cn
 * @description
 */
public class SQLTestDataEntity {

    int id;
    String input;     // 输入
    String output;    // 输出
    String className; // 类名
    String inputDesc; // 输入描述
    String outputDesc;// 输出描述
    String describe;  // 题目描述

    public SQLTestDataEntity(int id, String input, String output, String className) {
        this.id = id;
        this.input = input;
        this.output = output;
        this.className = className;
    }

    public SQLTestDataEntity(int id, String input, String output, String className, String inputDesc, String outputDesc, String describe) {
        this.id = id;
        this.input = input;
        this.output = output;
        this.className = className;
        this.inputDesc = inputDesc;
        this.outputDesc = outputDesc;
        this.describe = describe;
    }

    public void print() {
        System.out.println("SQLTestDataEntity: " +
                "id: " + this.id +
                "\n                   input: " + this.input +
                "\n                   output: " + this.output +
                "\n                   className: " + this.className
        );
    }

    /**
     * 输出int的input
     * 输出int[]的input
     * 输出int[][]的input
     * 输出String的input
     * 输出String[]的input
     * <p>
     * 输出int的output
     * 输出int[]的output
     * 输出int[][]的output
     * 输出String的output
     * 输出String[]的output
     */

    public int getIntInput() {
        return StringHandler.TransString2Int(this.input);
    }

    public int[] getIntArrayInput() {
        return StringHandler.TransString2IntArray(this.input);
    }

    public int[][] getIntMatrixInput() {
        return StringHandler.TransString2IntMatrix(this.input);
    }

    public String getStringInput() {
        return StringHandler.TransString2FormatString(this.input);
    }

    public String[] getStringArrayInput() {
        return StringHandler.TransString2StringArray(this.input);
    }

    // -------OutPut-------
    public int getIntOutput() {
        return StringHandler.TransString2Int(this.output);
    }

    public int[] getIntArrayOutput() {
        return StringHandler.TransString2IntArray(this.output);
    }

    public int[][] getIntMatrixOutput() {
        return StringHandler.TransString2IntMatrix(this.output);
    }

    public String getStringOutput() {
        return StringHandler.TransString2FormatString(this.output);
    }

    public String[] getStringArrayOutput() {
        return StringHandler.TransString2StringArray(this.output);
    }

}
